package com.shiminghui.String;

import java.util.Scanner;

public class JinErZhuanHuan {
    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        int money = 0;
        while (true) {
            money = scanner.nextInt();
            if (money > 0) {
                break;
            } else {
                System.out.println("金额无效");
            }
        }

        System.out.println(smallToBig(money));
    }

    public static String smallToBig(int num) {
        String s = numToString(num);
        char[] big = {'零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖'};
//        char [] danwei = {'拾','佰','仟','万'};
        char[] result = {'零', '佰', '零', '拾', '零', '万', '零', '仟', '零', '佰', '零', '拾', '零', '元'};
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != '0') {
                result[result.length - i * 2 - 2] = big[(int) s.charAt(i) - 48];
            }
        }


        return charToString(result);
    }


    private static String numToString(int num) {
        int count = 0;
        int temp = num;
        while (num != 0) {
            num = num / 10;
            count++;
        }
        String s = "";
        for (int i = 0; i < count; i++) {
            s = s + temp % 10;
            temp = temp / 10;
        }
        return s;
//        return reverser(s);

    }

    public static String reverser(String s) {
        String string = "";
        for (int i = s.length() - 1; i >= 0; i--) {
            string = string + s.charAt(i);
        }
        return string;

    }

    public static String charToString(char[] chars) {
        String s = "";
        for (int i = 0; i < chars.length; i++) {
            s = s + chars[i];
        }
        return s;
    }
}
